package networkListener;

import java.util.HashMap;
import java.util.Map;

public class PacketStatistics {

    private final Map<String, Long> statistics = new HashMap<>();

    public void addStatistics(String key, long length) {
        statistics.put(key, statistics.getOrDefault(key, 0L) + length);
    }

    public void printStatistics() {
        statistics.forEach((key, value) -> {
            System.out.println("MAC/IP Pair: " + key + " | Total Traffic: " + value + " bytes");
        });
    }
}
